<!DOCTYPE html>
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
  <meta name="description" content="tong.li&#39;s blog">
  <meta name="keyword" content="彤哥哥博客，95后技术爱好者,现就职于同程旅行/同程艺龙上海分公司，专注于互联网技术分享的平台。">
  
    <link rel="shortcut icon" href="/css/images/icon.png">
  
  <title>
    
      彤哥哥的博客
    
  </title>
  <link href="https://cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
  <link href="https://cdn.staticfile.org/nprogress/0.2.0/nprogress.min.css" rel="stylesheet">
  <link href="https://cdn.staticfile.org/highlight.js/9.12.0/styles/tomorrow-night.min.css" rel="stylesheet">
  
<link rel="stylesheet" href="/css/style.css">

  
  <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://cdn.staticfile.org/geopattern/1.2.3/js/geopattern.min.js"></script>
  <script src="https://cdn.staticfile.org/nprogress/0.2.0/nprogress.min.js"></script>
  
    
<script src="/js/qrious.js"></script>

  
  
  
  
    <!-- MathJax support START -->
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
        }
      });
    </script>

    <script type="text/x-mathjax-config">
      MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
      });
    </script>
    <script type="text/javascript" src="https://cdn.staticfile.org/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <!-- MathJax support END -->
  


  
  
    
<script src="/js/local-search.js"></script>


<meta name="generator" content="Hexo 5.4.2"></head>
<div class="wechat-share">
  <img src="/css/images/logo.png" />
</div>
  <body>
    <header class="header fixed-header">
  <div class="header-container">
    <a class="home-link" href="/">
      <div class="logo"></div>
      <span>彤哥哥的博客</span>
    </a>
    <ul class="right-list">
      
        <li class="list-item">
          
            <a href="/" class="item-link active">主页</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/series/" class="item-link">分类</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/tags/" class="item-link">标签</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/archives/" class="item-link">归档</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/project/" class="item-link">项目</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/about/" class="item-link">关于</a>
          
        </li>
      
      
        <li class="menu-item menu-item-search right-list">
    <a role="button" class="popup-trigger">
        <i class="fa fa-search fa-fw"></i>
    </a>
</li>
      
    </ul>
    <div class="menu">
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </div>
    <div class="menu-mask">
      <ul class="menu-list">
        
          <li class="menu-item">
            
              <a href="/" class="menu-link mobile-active">主页</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/series/" class="menu-link">分类</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/tags/" class="menu-link">标签</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/archives/" class="menu-link">归档</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/project/" class="menu-link">项目</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/about/" class="menu-link">关于</a>
            
          </li>
        
      </ul>
    </div>
    
      <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
            <span class="search-icon">
                <i class="fa fa-search"></i>
            </span>
            <div class="search-input-container">
                <input autocomplete="off" autocapitalize="off"
                    placeholder="Please enter your keyword(s) to search." spellcheck="false"
                    type="search" class="search-input">
            </div>
            <span class="popup-btn-close">
                <i class="fa fa-times-circle"></i>
            </span>
        </div>
        <div id="search-result">
            <div id="no-result">
                <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
            </div>
        </div>
    </div>
</div>
    
  </div>
</header>

    <main class="app-body">
  
    <article class="article-card">
      <h2 class="article-head">
        <a href="/2018/05/18/%E8%87%AA%E5%AE%9A%E4%B9%89%E4%B8%80%E4%B8%AASpring%20Boot%20Starter/">自定义一个Spring Boot Starter</a>
      </h2>
      <p class="article-date">May 18, 2018</p>
      
        
  <a href="/tags#Spring Boot" >
    <span class="tag-code">Spring Boot</span>
  </a>

      
      <div class="article-summary">
        
          我们可以模仿之前http编码自动配置的例子也协议一个starter,目的是为了降低耦合性.虽说可以降低程序依赖之间的耦合性,但是我们不建议自己定义starter,因为Spring Boot或其他社区已经提供了大部分的starter,可以满足我们日常的需求.本篇博文主要为了让大家更好的理解Sp ...
        
      </div>
      <a class="more" href="/2018/05/18/%E8%87%AA%E5%AE%9A%E4%B9%89%E4%B8%80%E4%B8%AASpring%20Boot%20Starter/">阅读更多</a>
    </article>
  
    <article class="article-card">
      <h2 class="article-head">
        <a href="/2018/05/17/Spring%20Boot%E8%87%AA%E5%8A%A8%E5%8E%9F%E7%90%86%E5%89%96%E6%9E%90/">Spring Boot自动配置原理剖析</a>
      </h2>
      <p class="article-date">May 17, 2018</p>
      
        
  <a href="/tags#Spring Boot" >
    <span class="tag-code">Spring Boot</span>
  </a>

      
      <div class="article-summary">
        
          神奇魔法-自动配置前篇文章讲述了Spring 4 条件注解,其实Spring Boot自动配置神奇实现也是基于这一原理的.若想知道Spring Boot为我们做了哪些的自动配置,可以查看这里的源码.可以通过以下三种方式查看项目中已启用和未启用的自动配置报告.

运行jar时增加–debug参 ...
        
      </div>
      <a class="more" href="/2018/05/17/Spring%20Boot%E8%87%AA%E5%8A%A8%E5%8E%9F%E7%90%86%E5%89%96%E6%9E%90/">阅读更多</a>
    </article>
  
    <article class="article-card">
      <h2 class="article-head">
        <a href="/2018/05/17/Spring%E6%9D%A1%E4%BB%B6%E6%B3%A8%E8%A7%A3@Conditional/">Spring条件注解@Conditional</a>
      </h2>
      <p class="article-date">May 17, 2018</p>
      
        
  <a href="/tags#Spring" >
    <span class="tag-code">Spring</span>
  </a>

      
      <div class="article-summary">
        
          @Conditional注解Spring 4提供了一个基于条件的Bean的创建,即使用@Conditional注解.@Conditional根据满足某一个特定条件创建一个特定的Bean.比如说,当某一个jar包在一个类路径下的时候,自动配置一个或多个Bean;或者只有某个Bean被创建才会创 ...
        
      </div>
      <a class="more" href="/2018/05/17/Spring%E6%9D%A1%E4%BB%B6%E6%B3%A8%E8%A7%A3@Conditional/">阅读更多</a>
    </article>
  
    <article class="article-card">
      <h2 class="article-head">
        <a href="/2018/05/15/Spring%E5%AE%B9%E5%99%A8%E4%BB%A5%E5%8F%8ABean%E7%9A%84%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F/">Spring容器以及Bean的生命周期</a>
      </h2>
      <p class="article-date">May 15, 2018</p>
      
        
  <a href="/tags#Spring" >
    <span class="tag-code">Spring</span>
  </a>

      
      <div class="article-summary">
        
          Spring容器容器是Spring框架的核心.Spring容器使用DI管理构成应用的组件,他会创建相互协作的组件之间的关联.Spring容器并不是只有一个.Spring自带多个容器实现,可归纳为两种不同的类型:

Bean工厂(由BeanFactory接口定义)是最简单的同期,提供基本的DI ...
        
      </div>
      <a class="more" href="/2018/05/15/Spring%E5%AE%B9%E5%99%A8%E4%BB%A5%E5%8F%8ABean%E7%9A%84%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F/">阅读更多</a>
    </article>
  
    <article class="article-card">
      <h2 class="article-head">
        <a href="/2018/05/10/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%B9%8B%E6%8E%92%E5%BA%8F/">数据结构之排序</a>
      </h2>
      <p class="article-date">May 10, 2018</p>
      
        
  <a href="/tags#排序算法" >
    <span class="tag-code">排序算法</span>
  </a>

      
      <div class="article-summary">
        
          数据结构和算法是整个计算机科学与技术领域永远逃避不了的话题,博主大学有过数据结构这门学科,不过特别后悔当时没有好好学习.仅学的那么点东西现在几乎忘得一干二净.虽说学的浅薄,但对整个编程思想还是很有帮助的.
十种常见排序算法十种常见排序算法可分为两大类:

非线性时间比较类排序：通过比较来决定 ...
        
      </div>
      <a class="more" href="/2018/05/10/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%B9%8B%E6%8E%92%E5%BA%8F/">阅读更多</a>
    </article>
  
    <article class="article-card">
      <h2 class="article-head">
        <a href="/2018/04/04/%E5%86%85%E7%BD%91%E7%A9%BF%E9%80%8F%E7%A5%9E%E5%99%A8-Ngrok/">内网穿透神器-Ngrok</a>
      </h2>
      <p class="article-date">April 4, 2018</p>
      
        
  <a href="/tags#实用工具及技巧" >
    <span class="tag-code">实用工具及技巧</span>
  </a>

      
      <div class="article-summary">
        
          作为一个Web开发者,我们有时候会需要临时地将一个本地的Web网站部署到外网,以供他人体验评价或协助调试等等,通常我们会这么做:

找到一台运行于外网的Web服务器;
服务器上搭建网站运行时的环境;
部署网站
调试结束后,再将网站从服务器上删除

我们部署静态的网站仅仅只是需要展示给朋友,何 ...
        
      </div>
      <a class="more" href="/2018/04/04/%E5%86%85%E7%BD%91%E7%A9%BF%E9%80%8F%E7%A5%9E%E5%99%A8-Ngrok/">阅读更多</a>
    </article>
  
    <article class="article-card">
      <h2 class="article-head">
        <a href="/2018/03/27/%E5%8D%95%E4%BE%8B%E6%A8%A1%E5%BC%8F-Spring%E5%8D%95%E4%BE%8B%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86%E5%88%86%E6%9E%90/">单例模式-Spring单例实现原理分析</a>
      </h2>
      <p class="article-date">March 27, 2018</p>
      
        
  <a href="/tags#Spring" >
    <span class="tag-code">Spring</span>
  </a>

      
      <div class="article-summary">
        
          在Spring中,被@Scope注解修饰Bean默认是单例模式的,即只有一个实例对象,多次获取Bean会拿到同一个对象.
单例注册表Spring采用单例注册表的特殊方式实现单例模式.首先自己写个单例注册表.我们可以通过Map缓存单例对象,实现单例注册表.值得注意的是,采用Concurrent ...
        
      </div>
      <a class="more" href="/2018/03/27/%E5%8D%95%E4%BE%8B%E6%A8%A1%E5%BC%8F-Spring%E5%8D%95%E4%BE%8B%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86%E5%88%86%E6%9E%90/">阅读更多</a>
    </article>
  
    <article class="article-card">
      <h2 class="article-head">
        <a href="/2018/03/15/%E7%BA%BF%E7%A8%8B%E5%88%87%E6%8D%A2%E5%AF%BC%E8%87%B4ThreadLocal%E6%95%B0%E6%8D%AE%E4%B8%A2%E5%A4%B1%E5%88%86%E6%9E%90/">线程切换导致ThreadLocal数据丢失分析</a>
      </h2>
      <p class="article-date">March 15, 2018</p>
      
        
  <a href="/tags#Java" >
    <span class="tag-code">Java</span>
  </a>

      
      <div class="article-summary">
        
          最近在使用Spring Cloud过程中,经常会遇见线程隔离(切换).导致ThreadLocal数据丢失.例如调用其他服务获取不到Threadlocal没有数据,服务之间传递请求头传递失败.通过查阅相关文档才发现:用Hystrix实现断路器,Zuul中默认使用的是信号量,其他默认都是线程隔离 ...
        
      </div>
      <a class="more" href="/2018/03/15/%E7%BA%BF%E7%A8%8B%E5%88%87%E6%8D%A2%E5%AF%BC%E8%87%B4ThreadLocal%E6%95%B0%E6%8D%AE%E4%B8%A2%E5%A4%B1%E5%88%86%E6%9E%90/">阅读更多</a>
    </article>
  
    <article class="article-card">
      <h2 class="article-head">
        <a href="/2018/02/07/%E4%BD%BF%E7%94%A8Jenkins%E8%BF%9B%E8%A1%8C%E6%8C%81%E7%BB%AD%E9%9B%86%E6%88%90/">使用Jenkins进行持续集成</a>
      </h2>
      <p class="article-date">February 7, 2018</p>
      
        
  <a href="/tags#Jenkins" >
    <span class="tag-code">Jenkins</span>
  </a>

      
      <div class="article-summary">
        
          Jenkins是一个开源软件项目，是基于Java开发的一种持续集成工具，用于监控持续重复的工作，旨在提供一个开放易用的软件平台，使软件的持续集成变成可能。
安装Jenkins首先我们去Jenkins官方网站下载最新的部署包(.war):Jenkins.因为我是在Linux平台部署,需要注意的 ...
        
      </div>
      <a class="more" href="/2018/02/07/%E4%BD%BF%E7%94%A8Jenkins%E8%BF%9B%E8%A1%8C%E6%8C%81%E7%BB%AD%E9%9B%86%E6%88%90/">阅读更多</a>
    </article>
  
    <article class="article-card">
      <h2 class="article-head">
        <a href="/2018/01/30/%E6%B5%85%E8%B0%88%E5%8C%BF%E5%90%8D%E5%87%BD%E6%95%B0,Lambda,%E9%97%AD%E5%8C%85(Closure)/">浅谈匿名函数,Lambda和闭包(Closure)</a>
      </h2>
      <p class="article-date">January 30, 2018</p>
      
        
  <a href="/tags#Java" >
    <span class="tag-code">Java</span>
  </a>

      
      <div class="article-summary">
        
          几乎所有的主流编程语言都对函数式编程有支持,我所用过的比如Java8的Lambda表达式,JavaScript和Groovy语言的闭包(Closure)等,其他的类似于Object-C的block,python的Lambda和C++11,看到这些,我都有点眩晕想吐的感觉.
匿名函数,Lamb ...
        
      </div>
      <a class="more" href="/2018/01/30/%E6%B5%85%E8%B0%88%E5%8C%BF%E5%90%8D%E5%87%BD%E6%95%B0,Lambda,%E9%97%AD%E5%8C%85(Closure)/">阅读更多</a>
    </article>
  

  
    <div class="guide-pager">
  
    <a href="/page/7/"><span class="page-arrow">← </span>Prev</a>
  
  
    <a href="/page/9/">Next<span class="page-arrow"> →</span></a>
  
</div>
  
</main>


    <div class="scroll-top">
  <span class="arrow-icon"></span>
</div>
    <footer class="app-footer">
  <p class="copyright">
    &copy; 2024 | Proudly powered by <a href="https://hexo.io" target="_blank">Hexo</a>
    <br>
    Theme by <a target="_blank" rel="noopener" href="https://github.com/ltyeamin">tong.li</a>
  </p>
</footer>

<script>
  function async(u, c) {
    var d = document, t = 'script',
      o = d.createElement(t),
      s = d.getElementsByTagName(t)[0];
    o.src = u;
    if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
    s.parentNode.insertBefore(o, s);
  }
</script>
<script>
  async("https://cdn.staticfile.org/fastclick/1.0.6/fastclick.min.js", function(){
    FastClick.attach(document.body);
  })
</script>

<script>
  var hasLine = 'true';
  async("https://cdn.staticfile.org/highlight.js/9.12.0/highlight.min.js", function(){
    $('figure pre').each(function(i, block) {
      var figure = $(this).parents('figure');
      if (hasLine === 'false') {
        figure.find('.gutter').hide();
      }
      hljs.configure({useBR: true});
      var lang = figure.attr('class').split(' ')[1] || 'code';
      var codeHtml = $(this).html();
      var codeTag = document.createElement('code');
      codeTag.className = lang;
      codeTag.innerHTML = codeHtml;
      $(this).attr('class', '').empty().html(codeTag);
      figure.attr('data-lang', lang.toUpperCase());
      hljs.highlightBlock(block);
    });
  })
</script>
<!-- Baidu Tongji -->



<script src='https://cdn.staticfile.org/mermaid/8.11.2/mermaid.min.js'></script>



<script src="/js/script.js"></script>


  </body>
</html>